require("../../../@babel/runtime/helpers/Arrayincludes");
var e,
  t,
  n = require("../../../@babel/runtime/helpers/typeof");
module.exports =
  ((e = {}),
  (t = function (t, i) {
    if (!e[t]) return require(i);
    if (!e[t].status) {
      var o = e[t].m;
      o._exports = o._tempexports;
      var r = Object.getOwnPropertyDescriptor(o, "exports");
      r &&
        r.configurable &&
        Object.defineProperty(o, "exports", {
          set: function (e) {
            "object" === n(e) &&
              e !== o._exports &&
              ((o._exports.__proto__ = e.__proto__),
              Object.keys(e).forEach(function (t) {
                o._exports[t] = e[t];
              })),
              (o._tempexports = e);
          },
          get: function () {
            return o._tempexports;
          },
        }),
        (e[t].status = 1),
        e[t].func(e[t].req, o, o.exports);
    }
    return e[t].m.exports;
  }),
  (function (t, n, i) {
    e[t] = { status: 0, func: n, req: i, m: { exports: {}, _tempexports: {} } };
  })(
    1690378507729,
    function (e, t, i) {
      !(function (e, o) {
        "object" == n(i) && void 0 !== t
          ? (t.exports = o())
          : "function" == typeof define && define.amd
            ? define(o)
            : ((e =
                "undefined" != typeof globalThis
                  ? globalThis
                  : e || self).Aegis = o());
      })(this, function () {
        var e = function (t, n) {
          return (e =
            Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array
              ? function (e, t) {
                  e.__proto__ = t;
                }
              : function (e, t) {
                  for (var n in t)
                    Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
                }))(t, n);
        };
        function t(t, n) {
          function i() {
            this.constructor = t;
          }
          e(t, n),
            (t.prototype =
              null === n
                ? Object.create(n)
                : ((i.prototype = n.prototype), new i()));
        }
        var i = function () {
          return (i =
            Object.assign ||
            function (e) {
              for (var t, n = 1, i = arguments.length; n < i; n++)
                for (var o in (t = arguments[n]))
                  Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
              return e;
            }).apply(this, arguments);
        };
        function o() {
          for (var e = 0, t = 0, n = arguments.length; t < n; t++)
            e += arguments[t].length;
          var i = Array(e),
            o = 0;
          for (t = 0; t < n; t++)
            for (var r = arguments[t], a = 0, s = r.length; a < s; a++, o++)
              i[o] = r[a];
          return i;
        }
        Object.assign ||
          Object.defineProperty(Object, "assign", {
            enumerable: !1,
            configurable: !0,
            writable: !0,
            value: function (e) {
              if (null == e)
                throw new TypeError("Cannot convert first argument to object");
              for (var t = Object(e), n = 1; n < arguments.length; n++)
                if (null != (i = arguments[n]))
                  for (
                    var i = Object(i),
                      o = Object.keys(Object(i)),
                      r = 0,
                      a = o.length;
                    r < a;
                    r++
                  ) {
                    var s = o[r],
                      l = Object.getOwnPropertyDescriptor(i, s);
                    null != l && l.enumerable && (t[s] = i[s]);
                  }
              return t;
            },
          });
        var r = /_?t(\d)?(imestamp)?=\d+&?/g,
          a = [
            "aegis.qq.com",
            "tamaegis.com",
            "/aegis-sdk",
            "rumt-",
            "/flog.core.min.js",
            "pingfore.qq.com",
            "pingfore.tencent.com",
            "zhiyan.tencent-cloud.net",
            "h.trace.qq.com",
            "btrace.qq.com",
            "beacon.qq.com",
            "dmplog.qq.com",
            "qq.com/report",
            "svibeacon.onezapp.com",
            "cube.weixinbridge.com",
            "doubleclick.net",
            "pcmgrmonitor.3g.qq.com",
            "report.qqweb.qq.com",
            "tpstelemetry.tencent.com",
            "insight.cloud.tencent.com",
            "facebook.com",
            "facebook.net",
            "google",
            "yahoo.com",
            "twitter.com",
            "ga-audiences",
            "report.idqqimg.com",
            "arms-retcode.aliyuncs.com",
            "px.effirst.com",
            "sentry",
            "hot-update.json",
            "u.c.b.r.o.w.s.e.r",
            "report.url.cn",
            "sockjs-node",
            "m3u8",
          ],
          s = ["ext1", "ext2", "ext3", "level", "trace", "tag", "seq", "code"],
          l =
            ((c.prototype.indexOf = function (e, t) {
              for (var n = 0; n < e.length; n++)
                if (e[n].callback === t) return n;
              return -1;
            }),
            (c.prototype.on = function (e, t, n) {
              var i;
              if ((void 0 === n && (n = 0), this))
                return (
                  (i = this.eventsList[e]) ||
                    ((this.eventsList[e] = []), (i = this.eventsList[e])),
                  -1 === this.indexOf(i, t) &&
                    i.push({ name: e, type: n || 0, callback: t }),
                  this
                );
            }),
            (c.prototype.one = function (e, t) {
              this.on(e, t, 1);
            }),
            (c.prototype.remove = function (e, t) {
              if (this) {
                var n = this.eventsList[e];
                if (n) {
                  if (t)
                    return (
                      n.length && ((t = this.indexOf(n, t)), n.splice(t, 1)),
                      this
                    );
                  try {
                    delete this.eventsList[e];
                  } catch (e) {}
                }
                return null;
              }
            }),
            (c.prototype.clear = function () {
              this.eventsList = {};
            }),
            c),
          u = function (e) {
            if (!e || 0 === e.length) return "{}";
            e = Array.isArray(e) ? e : [e];
            var t = Object.keys(e[0]),
              n = {},
              i =
                (t.forEach(function (t) {
                  n[t] = e.map(function (e) {
                    return e[t];
                  });
                }),
                (n.count = e.length),
                n);
            if ("string" == typeof i) return i;
            try {
              return JSON.stringify(i, M()) || "undefined";
            } catch (i) {
              return (
                "error happen when aegis stringify: \n " +
                i.message +
                " \n " +
                i.stack
              );
            }
          };
        function c() {
          var e = this;
          (this.emit = function (t, n) {
            if (e) {
              var i;
              if (null != (o = e.eventsList[t]) && o.length)
                for (var o = o.slice(), r = 0; r < o.length; r++) {
                  i = o[r];
                  try {
                    var a = i.callback.apply(e, [n]);
                    if ((1 === i.type && e.remove(t, i.callback), !1 === a))
                      break;
                  } catch (t) {
                    throw t;
                  }
                }
              return e;
            }
          }),
            (this.eventsList = {});
        }
        function f(e, t) {
          return "string" == typeof e ? e.split("?")[t ? 1 : 0] || "" : e;
        }
        function p(e) {
          return "string" == typeof e && /^\//.test(e)
            ? "https:" ===
                (null === location || void 0 === location
                  ? void 0
                  : location.protocol)
            : /^https/.test(e);
        }
        function d(e, t, n) {
          var i, o;
          try {
            if ("function" == typeof (null == t ? void 0 : t.retCodeHandler))
              return {
                code:
                  void 0 ===
                  (r = (o =
                    t.retCodeHandler(
                      e,
                      null == n ? void 0 : n.url,
                      null == n ? void 0 : n.ctx,
                      null == n ? void 0 : n.payload,
                    ) || {}).code)
                    ? "unknown"
                    : r,
                isErr: o.isErr,
              };
            if (!(e = "string" == typeof e ? JSON.parse(e) : e))
              return { code: "unknown", isErr: !1 };
            "function" ==
              typeof (null == (i = null == t ? void 0 : t.ret)
                ? void 0
                : i.join) &&
              (D = [].concat(
                t.ret.map(function (e) {
                  return e.toLowerCase();
                }),
              ));
            var r,
              a = Object.getOwnPropertyNames(e).filter(function (e) {
                return -1 !== D.indexOf(e.toLowerCase());
              });
            return a.length
              ? {
                  code:
                    "" +
                    (r = "未知" !== (r = e[a[0]]) && "" !== r ? r : "unknown"),
                  isErr: 0 !== r && "0" !== r && "unknown" !== r,
                }
              : { code: "unknown", isErr: !1 };
          } catch (e) {
            return { code: "unknown", isErr: !1 };
          }
        }
        function h(e, t, n) {
          try {
            var i =
              "function" == typeof t
                ? t(e, null == n ? void 0 : n.url) || ""
                : e;
            return B(i).slice(0, 102400);
          } catch (e) {
            return "";
          }
        }
        function g(e, t) {
          return (
            "string" != typeof e ||
            !e ||
            (t && -1 < e.indexOf(t)) ||
            W.test(e) ||
            a.some(function (t) {
              return -1 < e.indexOf(t);
            })
          );
        }
        function m(e, t) {
          var n,
            i = [],
            o = e.config;
          return (
            e.lifeCycle.on("destroy", function () {
              i.length = 0;
            }),
            function (r, a) {
              Array.isArray(r) ? (i = i.concat(r)) : i.push(r),
                (t && i.length >= t) || (e.sendNow && 0 < i.length)
                  ? ((i = G(i)), a(i.splice(0, i.length)), n && clearTimeout(n))
                  : (n && clearTimeout(n),
                    (n = setTimeout(function () {
                      (n = null),
                        0 < (i = G(i)).length && a(i.splice(0, i.length));
                    }, o.delay)));
            }
          );
        }
        function v(e, t) {
          return Array.isArray(e)
            ? t(
                e.map(function (e) {
                  return (
                    (t = i(i({}, e), {
                      msg:
                        "string" == typeof e.msg
                          ? e.msg
                          : [].concat(e.msg).map(F).join(" "),
                    })),
                    s.forEach(function (e) {
                      t[e] || delete t[e];
                    }),
                    t
                  );
                  var t;
                }),
              )
            : t([
                i(i({}, e), {
                  msg: "string" == typeof e.msg ? e.msg : F(e.msg),
                }),
              ]);
        }
        function y(e, t) {
          return function (n, o) {
            var r,
              a,
              l,
              u = Array.isArray(n),
              c = u ? n : [n],
              f =
                (e.lifeCycle.emit("beforeRequest", n), e.config.beforeRequest);
            (c =
              "function" == typeof f
                ? c
                    .map(function (e) {
                      try {
                        var n = f({ logs: e, logType: t });
                        return (null == n ? void 0 : n.logType) === t &&
                          null != n &&
                          n.logs
                          ? n.logs
                          : !1 !== n && e;
                      } catch (n) {
                        return e;
                      }
                    })
                    .filter(function (e) {
                      return !1 !== e;
                    })
                : c).length &&
              ((r = c),
              (n = s),
              !Array.isArray(r) ||
                r.length <= 1 ||
                ((a = []), (l = []), !(l = "string" == typeof n ? [n] : n)) ||
                l.length <= 0 ||
                (l.forEach(function (e) {
                  r.forEach(function (t) {
                    null != t && t[e] && a.push(e);
                  });
                }),
                0 < a.length &&
                  (r = r.map(function (e) {
                    var t = {};
                    return (
                      a.forEach(function (e) {
                        t[e] = "";
                      }),
                      i(i({}, t), e)
                    );
                  }))),
              (c = r),
              o(u ? c : c[0]));
          };
        }
        function b(e) {
          return function (t, i) {
            e.lifeCycle.emit("modifyRequest", t);
            var o = e.config.modifyRequest;
            if ("function" == typeof o)
              try {
                var r = o(t);
                "object" == n(r) && "url" in r && (t = r);
              } catch (t) {
                console.error(t);
              }
            i(t);
          };
        }
        function O(e) {
          return function (t, n) {
            null != (i = e.lifeCycle) && i.emit("afterRequest", t);
            var i = (e.config || {}).afterRequest;
            ("function" == typeof i && !1 === i(t)) || n(t);
          };
        }
        function E(e) {
          if (e && e.reduce && e.length)
            return 1 === e.length
              ? function (t, n) {
                  e[0](t, n || Z);
                }
              : e.reduce(function (e, t) {
                  return function (n, i) {
                    return (
                      void 0 === i && (i = Z),
                      e(n, function (e) {
                        return null == t ? void 0 : t(e, i);
                      })
                    );
                  };
                });
          throw new TypeError(
            "createPipeline need at least one function param",
          );
        }
        function R(e, t) {
          Object.getOwnPropertyNames(e).forEach(function (n) {
            "function" == typeof e[n] &&
              "constructor" !== n &&
              (t
                ? (t[n] =
                    "sendPipeline" === n
                      ? function () {
                          return function () {};
                        }
                      : function () {})
                : (e[n] = function () {}));
          });
        }
        function w(e) {
          try {
            var t,
              n,
              i,
              o = "";
            return (
              (o =
                e.pageUrl ||
                ((n = (t = getCurrentPages())[t.length - 1] || {}),
                (r = n.options),
                (i = Object.keys(r).length
                  ? "?" +
                    Object.keys(r)
                      .map(function (e) {
                        return e + "=" + r[e];
                      })
                      .join("&")
                  : ""),
                n.route ? n.route + i : "")),
              (o =
                "function" == typeof e.urlHandler ? e.urlHandler() : o).slice(
                0,
                2048,
              )
            );
          } catch (e) {
            return "";
          }
          var r;
        }
        function P(e, t) {
          if ("string" == typeof e && "string" == typeof t) {
            if (e === t) return 1;
            for (
              var n = e.split("."),
                i = t.split("."),
                o = Math.max(n.length, i.length),
                r = 0;
              r < o;
              r++
            ) {
              var a = ~~n[r],
                s = ~~i[r];
              if (a < s) return;
              if (s < a) return 1;
            }
          }
        }
        function S(e, t) {
          var n = this;
          (this.taskQueue = []),
            (this.count = 1),
            (this.maxCount = 2),
            (this.addTask = function (e) {
              n.taskQueue.push(e);
            }),
            (this.fireTask = function () {
              var e = n.taskQueue.length;
              n.count > n.maxCount ||
                0 === e ||
                ((n.count = n.count + 1),
                (e = n.taskQueue.shift()) &&
                  n.sendRequest(
                    e.options,
                    null == e ? void 0 : e.success,
                    null == e ? void 0 : e.fail,
                  ));
            }),
            (this.complete = function () {
              1 < n.count && (n.count = n.count - 1), n.fireTask();
            }),
            t && (this.maxCount = t),
            (this.sendRequest = e);
        }
        function x(e) {
          return P((ie = ie || ne.getSystemInfoSync().SDKVersion), "1.1.1") &&
            ne.canIUse
            ? ne.canIUse(e)
            : !!ne[e];
        }
        function T(e) {
          for (
            var t,
              n = {
                unknown: /unknown|none/i,
                wifi: /wifi/i,
                net2g: /2g/i,
                net3g: /3g/i,
                net4g: /4g/i,
                net5g: /5g/i,
                net6g: /6g/i,
              },
              i = q.unknown,
              o = 0;
            o < Object.keys(n).length;
            o++
          ) {
            var r = Object.keys(n)[o];
            if (null != (t = n[r]) && t.test(e)) {
              i = q[r];
              break;
            }
          }
          return i;
        }
        function k(e) {
          var t = e.apiName,
            n = fe[t];
          n
            ? n.hackCloudReq.addCallback(e)
            : ((n = ce.cloud[t]),
              (fe[t] = { hackCloudReq: new pe(e), originApi: n })),
            fe[t];
        }
        function C(e) {
          var t = e.apiName,
            n = he[t];
          n
            ? n.hackReq.addCallback(e)
            : ((n = wx[t]), (he[t] = { hackReq: new ge(e), originApi: n })),
            he[t];
        }
        var N,
          L,
          q,
          A,
          _,
          j,
          U,
          H,
          I,
          D = ["ret", "retcode", "code", "errcode"],
          M = function () {
            var e = new WeakSet();
            return function (t, i) {
              if (i instanceof Error)
                return (
                  "Error.message: " + i.message + " \n  Error.stack: " + i.stack
                );
              if ("object" == n(i) && null !== i) {
                if (e.has(i)) return "[Circular " + (t || "root") + "]";
                e.add(i);
              }
              return i;
            };
          },
          F = function (e) {
            if ("string" == typeof e) return e;
            try {
              return e instanceof Error
                ? (JSON.stringify(e, M(), 4) || "undefined").replace(/"/gim, "")
                : JSON.stringify(e, M(), 4) || "undefined";
            } catch (e) {
              return (
                "error happen when aegis stringify: \n " +
                e.message +
                " \n " +
                e.stack
              );
            }
          },
          B = function e(t, i) {
            void 0 === i && (i = 3);
            var o,
              r,
              a,
              s = "";
            return (
              Array.isArray(t)
                ? ((s += "["),
                  (o = t.length),
                  t.forEach(function (t, r) {
                    s =
                      (s += "object" == n(t) && 1 < i ? e(t, i - 1) : V(t)) +
                      (r === o - 1 ? "" : ",");
                  }),
                  (s += "]"))
                : t instanceof Object
                  ? ((s = "{"),
                    (r = Object.keys(t)),
                    (a = r.length),
                    r.forEach(function (o, l) {
                      "object" == n(t[o]) && 1 < i
                        ? (s += '"' + o + '":' + e(t[o], i - 1))
                        : (s += J(o, t[o])),
                        (s +=
                          l === a - 1 || (l < a - 1 && void 0 === t[r[l + 1]])
                            ? ""
                            : ",");
                    }),
                    (s += "}"))
                  : (s += t),
              s
            );
          },
          J = function (e, t) {
            var i = n(t),
              o = "";
            return (
              "string" == i || "object" == i
                ? (o += '"' + e + '":"' + t + '"')
                : "function" == typeof t
                  ? (o += '"' + e + '":"function ' + t.name + '"')
                  : "symbol" == n(t)
                    ? (o += '"' + e + '":"symbol"')
                    : ("number" != typeof t && "boolean" != i) ||
                      (o += '"' + e + '": ' + t),
              o
            );
          },
          V = function (e) {
            var t = n(e);
            return (
              "" +
              ("undefined" == t || "symbol" == t || "function" == t
                ? "null"
                : "string" == t || "object" == t
                  ? '"' + e + '"'
                  : e)
            );
          },
          W = /data:(image|text|application|font)\/.*;base64/,
          G =
            (((ee = N = N || {}).INFO_ALL = "-1"),
            (ee.API_RESPONSE = "1"),
            (ee.INFO = "2"),
            (ee.ERROR = "4"),
            (ee.PROMISE_ERROR = "8"),
            (ee.AJAX_ERROR = "16"),
            (ee.SCRIPT_ERROR = "32"),
            (ee.IMAGE_ERROR = "64"),
            (ee.CSS_ERROR = "128"),
            (ee.CONSOLE_ERROR = "256"),
            (ee.MEDIA_ERROR = "512"),
            (ee.RET_ERROR = "1024"),
            (ee.REPORT = "2048"),
            (ee.PV = "4096"),
            (ee.EVENT = "8192"),
            (ee.PAGE_NOT_FOUND_ERROR = "16384"),
            (ee.WEBSOCKET_ERROR = "32768"),
            (ee.BRIDGE_ERROR = "65536"),
            (ee.LAZY_LOAD_ERROR = "131072"),
            ((ee = L = L || {})[(ee.android = 1)] = "android"),
            (ee[(ee.ios = 2)] = "ios"),
            (ee[(ee.windows = 3)] = "windows"),
            (ee[(ee.macos = 4)] = "macos"),
            (ee[(ee.linux = 5)] = "linux"),
            (ee[(ee.devtools = 6)] = "devtools"),
            (ee[(ee.other = 100)] = "other"),
            ((ee = q = q || {})[(ee.unknown = 100)] = "unknown"),
            (ee[(ee.wifi = 1)] = "wifi"),
            (ee[(ee.net2g = 2)] = "net2g"),
            (ee[(ee.net3g = 3)] = "net3g"),
            (ee[(ee.net4g = 4)] = "net4g"),
            (ee[(ee.net5g = 5)] = "net5g"),
            (ee[(ee.net6g = 6)] = "net6g"),
            ((ee = A = A || {}).LOG = "log"),
            (ee.SPEED = "speed"),
            (ee.PERFORMANCE = "performance"),
            (ee.OFFLINE = "offline"),
            (ee.WHITE_LIST = "whiteList"),
            (ee.VITALS = "vitals"),
            (ee.PV = "pv"),
            (ee.CUSTOM_PV = "customPV"),
            (ee.EVENT = "event"),
            (ee.CUSTOM = "custom"),
            (ee.SDK_ERROR = "sdkError"),
            (ee.SET_DATA = "setData"),
            (ee.LOAD_PACKAGE = "loadPackage"),
            ((ee = _ = _ || {}).production = "production"),
            (ee.development = "development"),
            (ee.gray = "gray"),
            (ee.pre = "pre"),
            (ee.daily = "daily"),
            (ee.local = "local"),
            (ee.test = "test"),
            (ee.others = "others"),
            function (e) {
              return e.filter(function (t, n) {
                return (
                  "static" !== t.type ||
                  !e.find(function (e, i) {
                    return t.url === e.url && 200 === t.status && n < i;
                  })
                );
              });
            }),
          K = function (e) {
            e.level === N.INFO_ALL && (e.level = N.INFO);
          },
          z = {},
          $ = {},
          X = function (e) {
            return (
              z[e] ||
                (z[e] = setTimeout(function () {
                  ($[e] = {}), (z[e] = null);
                }, 6e4)),
              z[e]
            );
          },
          Y = function (e) {
            return (Array.isArray(e) ? e : [e]).map(function (e) {
              return Object.getOwnPropertyNames(e).reduce(
                function (t, n) {
                  return "ctx" !== n && (t[n] = e[n]), t;
                },
                { level: N.INFO, msg: "" },
              );
            });
          },
          Q = function (e) {
            return function (t) {
              return e.sendPipeline(
                [
                  function (t, n) {
                    return n({
                      url: e.config.url || "",
                      data: u(Y(t)),
                      method: "post",
                      contentType: "application/json",
                      type: A.LOG,
                      log: t,
                      requestConfig: { timeout: 5e3 },
                      success: function () {
                        var i = e.config.onReport;
                        "function" == typeof i &&
                          t.forEach(function (e) {
                            i(e);
                          }),
                          "function" == typeof n && n([]);
                      },
                    });
                  },
                ],
                A.LOG,
              )(t);
            };
          },
          Z = function () {},
          ee =
            (Object.defineProperty(Pe.prototype, "__version__", {
              get: function () {
                return (
                  console.warn("__version__ has discard, please use version"),
                  "1.40.14"
                );
              },
              enumerable: !1,
              configurable: !0,
            }),
            Object.defineProperty(Pe.prototype, "LogType", {
              get: function () {
                return (
                  console.warn("LogType has discard, please use logType"), N
                );
              },
              enumerable: !1,
              configurable: !0,
            }),
            (Pe.prototype.init = function (e) {
              this.setConfig(e);
              for (var t = 0; t < Pe.installedPlugins.length; t++)
                try {
                  Pe.installedPlugins[t].patch(this);
                } catch (e) {
                  this.sendSDKError(e);
                }
              this.lifeCycle.emit("onInited");
            }),
            (Pe.prototype.setConfig = function (e) {
              Object.assign(this.config, e);
              var t = (e = this.config).id,
                n = e.uin,
                i = e.version,
                o = e.ext1,
                r = e.ext2,
                a = e.ext3,
                s = e.aid,
                l = void 0 === (u = e.env) ? "production" : u,
                u = e.pageUrl;
              return (
                (e =
                  this.bean.id !== t ||
                  this.bean.uin !== n ||
                  this.bean.aid !== s),
                (this.bean.id = t || ""),
                (this.bean.uin = n || ""),
                (this.bean.version = i || "1.40.14"),
                (this.bean.aid = s || ""),
                (this.bean.env = (function () {
                  switch (l) {
                    case _.production:
                    case _.development:
                    case _.gray:
                    case _.pre:
                    case _.daily:
                    case _.local:
                    case _.test:
                    case _.others:
                      return 1;
                    default:
                      return;
                  }
                })()
                  ? l
                  : _.others),
                u &&
                  this.extendBean("from", encodeURIComponent(u.slice(0, 2048))),
                o && this.extendBean("ext1", encodeURIComponent(o)),
                r && this.extendBean("ext2", encodeURIComponent(r)),
                a && this.extendBean("ext3", encodeURIComponent(a)),
                e && this.lifeCycle.emit("onConfigChange", this.config),
                this.config
              );
            }),
            (Pe.use = function (e) {
              -1 === Pe.installedPlugins.indexOf(e) &&
                e.aegisPlugin &&
                Pe.installedPlugins.push(e);
            }),
            (Pe.unuse = function (e) {
              -1 !== (e = Pe.installedPlugins.indexOf(e)) &&
                Pe.installedPlugins.splice(e, 1);
            }),
            (Pe.prototype.info = function () {
              for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
              var n = { level: N.INFO, msg: e };
              1 === e.length &&
                e[0].msg &&
                Object.assign(n, i({}, e[0]), { level: N.INFO }),
                this.normalLogPipeline(n);
            }),
            (Pe.prototype.infoAll = function () {
              for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
              var n = { level: N.INFO_ALL, msg: e };
              1 === e.length &&
                e[0].msg &&
                Object.assign(n, i({}, e[0]), { level: N.INFO_ALL }),
                this.normalLogPipeline(n);
            }),
            (Pe.prototype.report = function () {
              for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
              var n = { level: N.REPORT, msg: e };
              1 === e.length && e[0].msg && Object.assign(n, i({}, e[0])),
                this.normalLogPipeline(n);
            }),
            (Pe.prototype.error = function () {
              for (var e = [], t = 0; t < arguments.length; t++)
                e[t] = arguments[t];
              var n = { level: N.ERROR, msg: e };
              1 === e.length &&
                e[0].msg &&
                Object.assign(n, i({}, e[0]), { level: N.ERROR }),
                this.normalLogPipeline(n);
            }),
            (Pe.prototype.speedLogPipeline = function (e) {
              throw new Error('You need to override "speedLogPipeline" method');
            }),
            (Pe.prototype.reportPv = function (e) {
              var t,
                n = this;
              e &&
                (console.warn("reportPv is deprecated, please use reportEvent"),
                (t =
                  "" +
                  Object.getOwnPropertyNames(this.bean)
                    .filter(function (e) {
                      return "id" !== e;
                    })
                    .map(function (e) {
                      return e + "=" + n.bean[e];
                    })
                    .join("&")),
                this.sendPipeline(
                  [
                    function (i, o) {
                      o({
                        url: n.config.url + "/" + e + "?" + t,
                        addBean: !1,
                        type: A.CUSTOM_PV,
                      });
                    },
                  ],
                  A.CUSTOM_PV,
                )(null));
            }),
            (Pe.prototype.reportEvent = function (e) {
              e &&
                ((e =
                  "string" == typeof e
                    ? {
                        name: e,
                        ext1: this.config.ext1 || "",
                        ext2: this.config.ext2 || "",
                        ext3: this.config.ext3 || "",
                      }
                    : e).name
                  ? ("string" != typeof e.name &&
                      (console.warn("reportEvent params name must be string"),
                      (e.name = String(e.name))),
                    this.eventPipeline(e))
                  : console.warn("reportEvent params error"));
            }),
            (Pe.prototype.reportTime = function (e, t) {
              if ("object" == n(e)) return this.reportT(e);
              "string" == typeof e
                ? "number" == typeof t
                  ? t < 0 || 6e4 < t
                    ? console.warn(
                        "reportTime: duration must between 0 and 60000",
                      )
                    : this.submitCustomTime(e, t)
                  : console.warn("reportTime: second param must be number")
                : console.warn("reportTime: first param must be a string");
            }),
            (Pe.prototype.reportT = function (e) {
              var t = e.name,
                n = e.duration,
                i = void 0 === (i = e.ext1) ? "" : i,
                o = void 0 === (o = e.ext2) ? "" : o,
                r = void 0 === (r = e.ext3) ? "" : r;
              if (
                ((e = e.from),
                "string" == typeof t &&
                  "number" == typeof n &&
                  "string" == typeof i &&
                  "string" == typeof o &&
                  "string" == typeof r)
              ) {
                if (!(n < 0 || 6e4 < n))
                  return this.submitCustomTime(
                    t,
                    n,
                    i,
                    o,
                    r,
                    void 0 === e ? "" : e,
                  );
                console.warn("reportTime: duration must between 0 and 60000");
              } else console.warn("reportTime: params error");
            }),
            (Pe.prototype.time = function (e) {
              "string" == typeof e
                ? this.timeMap[e]
                  ? console.warn("Timer " + e + " already exists")
                  : (this.timeMap[e] = Date.now())
                : console.warn("time: first param must be a string");
            }),
            (Pe.prototype.timeEnd = function (e) {
              "string" == typeof e
                ? this.timeMap[e]
                  ? (this.submitCustomTime(e, Date.now() - this.timeMap[e]),
                    delete this.timeMap[e])
                  : console.warn("Timer " + e + " does not exist")
                : console.warn("timeEnd: first param must be a string");
            }),
            (Pe.prototype.submitCustomTime = function (e, t, n, i, o, r) {
              this.customTimePipeline({
                name: e,
                duration: t,
                ext1: n || this.config.ext1,
                ext2: i || this.config.ext2,
                ext3: o || this.config.ext3,
                from: r || void 0,
              });
            }),
            (Pe.prototype.extendBean = function (e, t) {
              this.bean[e] = t;
            }),
            (Pe.prototype.sendPipeline = function (e, t) {
              var n,
                i = this;
              return E(
                o(
                  [
                    function (e, t) {
                      if (
                        ("number" != typeof n.config.random &&
                          (console.warn("random must in [0, 1], default is 1."),
                          (n.config.random = 1)),
                        !n.isHidden || !n.isGetSample)
                      )
                        if (n.isGetSample) n.isHidden || t(e);
                        else {
                          if (
                            ((n.isGetSample = !0),
                            Math.random() < n.config.random)
                          )
                            return (n.isHidden = !1), t(e);
                          n.isHidden = !0;
                        }
                    },
                    y((n = this), t),
                  ],
                  e,
                  [
                    b(this),
                    function (e, t) {
                      i.request(
                        e,
                        function () {
                          for (var n, r = [], a = 0; a < arguments.length; a++)
                            r[a] = arguments[a];
                          (i.failRequestCount = 0),
                            t({
                              isErr: !1,
                              result: r,
                              logType: null == e ? void 0 : e.type,
                              logs: null == e ? void 0 : e.log,
                            }),
                            null != (n = null == e ? void 0 : e.success) &&
                              n.call.apply(n, o([e], r));
                        },
                        function () {
                          for (var n, r = [], a = 0; a < arguments.length; a++)
                            r[a] = arguments[a];
                          60 <= ++i.failRequestCount && i.destroy(),
                            -1 < ("" + r[0]).indexOf("403 forbidden") &&
                              i.destroy(),
                            t({
                              isErr: !0,
                              result: r,
                              logType: null == e ? void 0 : e.type,
                              logs: null == e ? void 0 : e.log,
                            }),
                            null != (n = null == e ? void 0 : e.fail) &&
                              n.call.apply(n, o([e], r));
                        },
                      );
                    },
                    O(this),
                  ],
                ),
              );
            }),
            (Pe.prototype.send = function (e, t, n) {
              var i = this;
              return E([
                b(this),
                function (e, o) {
                  i.request(
                    e,
                    function () {
                      for (var n = [], i = 0; i < arguments.length; i++)
                        n[i] = arguments[i];
                      o({ isErr: !1, result: n, logType: e.type, logs: e.log }),
                        null != t && t.apply(void 0, n);
                    },
                    function () {
                      for (var t = [], i = 0; i < arguments.length; i++)
                        t[i] = arguments[i];
                      o({ isErr: !0, result: t, logType: e.type, logs: e.log }),
                        null != n && n.apply(void 0, t);
                    },
                  );
                },
                O(this),
              ])(e);
            }),
            (Pe.prototype.ready = function (e, t, n) {
              throw new Error('You need to override "ready" method');
            }),
            (Pe.prototype.request = function (e, t, n) {
              throw new Error('You need to override "request" method');
            }),
            (Pe.prototype.sendSDKError = function (e) {
              var t = this;
              this.sendPipeline(
                [
                  function (e, n) {
                    n({
                      url:
                        t.config.url +
                        "?id=1085&msg[0]=" +
                        encodeURIComponent(F(e)) +
                        "&level[0]=2&from=" +
                        t.config.id +
                        "&count=1&version=" +
                        t.config.id +
                        "(1.40.14)",
                      addBean: !1,
                      method: "get",
                      type: A.SDK_ERROR,
                      log: e,
                    });
                  },
                ],
                A.SDK_ERROR,
              )(e);
            }),
            (Pe.prototype.destroy = function (e) {
              void 0 === e && (e = !1);
              var t,
                n,
                i = Pe.instances.indexOf(this);
              -1 !== i && Pe.instances.splice(i, 1);
              for (var o = Pe.installedPlugins.length - 1; 0 <= o; o--)
                try {
                  Pe.installedPlugins[o].unpatch(this);
                } catch (e) {
                  this.sendSDKError(e);
                }
              if ((this.lifeCycle.emit("destroy"), this.lifeCycle.clear(), e))
                (t = this),
                  (n = Object.getOwnPropertyDescriptors(t)),
                  Object.keys(n).forEach(function (e) {
                    n[e].writable && (t[e] = null);
                  }),
                  Object.setPrototypeOf(this, null);
              else {
                for (
                  var r = this;
                  r.constructor !== Object && R(r, this),
                    (r = Object.getPrototypeOf(r));

                );
                0 === Pe.instances.length &&
                  (R((i = Object.getPrototypeOf(this).constructor)), R(Pe));
              }
            }),
            (Pe.version = "1.40.14"),
            (Pe.instances = []),
            (Pe.logType = N),
            (Pe.environment = _),
            (Pe.installedPlugins = []),
            Pe),
          te =
            ((we.prototype.patch = function (e) {
              this.canUse(e) &&
                this.exist(e) &&
                (this.instances.push(e),
                this.triggerInit(e),
                this.triggerOnNewAegis(e));
            }),
            (we.prototype.unpatch = function (e) {
              var t = this.instances.indexOf(e);
              -1 !== t &&
                (this.instances.splice(t, 1), 0 === this.instances.length) &&
                this.uninstall(e);
            }),
            (we.prototype.countInstance = function () {
              return this.instances.length;
            }),
            (we.prototype.uninstall = function (e) {
              var t;
              null != (t = null == (t = this.option) ? void 0 : t.destroy) &&
                t.apply(this, [e]);
            }),
            (we.prototype.walk = function (e) {
              var t = this;
              this.instances.forEach(function (n) {
                var i = t.canUse(n);
                i && e(n, i);
              });
            }),
            (we.prototype.canUse = function (e) {
              return !(!(e = this.getConfig(e)) || "object" != n(e)) || !!e;
            }),
            (we.prototype.getConfig = function (e) {
              return null == (e = e.config) ? void 0 : e[this.name];
            }),
            (we.prototype.exist = function (e) {
              return -1 === this.instances.indexOf(e);
            }),
            (we.prototype.triggerInit = function (e) {
              var t;
              this.inited ||
                ((this.inited = !0),
                null == (t = null == (t = this.option) ? void 0 : t.init)) ||
                t.call(this.option, this.getConfig(e));
            }),
            (we.prototype.triggerOnNewAegis = function (e) {
              var t;
              null != (t = null == (t = this.option) ? void 0 : t.onNewAegis) &&
                t.call(this.option, e, this.getConfig(e));
            }),
            we),
          ne = wx || qq,
          ie = "",
          oe = new te({
            name: "offlineLog",
            onNewAegis: function (e) {
              if (ne.getFileSystemManager)
                try {
                  var t = e.config,
                    n = t.id,
                    i = void 0 === n ? "" : n,
                    o = t.uin,
                    r = void 0 === o ? 0 : o,
                    a = t.offlineUrl,
                    s = void 0 === a ? "" : a,
                    l = t.offlineLogLimit,
                    u = new re({ limit: l });
                  e.lifeCycle.on("beforeWrite", function (t) {
                    u.save2Offline((t = void 0 === t ? [] : t), e.config);
                  }),
                    u.ready(function (t) {
                      var n = (e.bean || {}).aid,
                        o = void 0 === n ? "" : n;
                      !t &&
                        i &&
                        (r || o) &&
                        e.send(
                          {
                            url: s + "/offlineAuto",
                            type: A.OFFLINE,
                            log: A.OFFLINE,
                          },
                          function (n) {
                            var a = (null == n ? void 0 : n.data).secretKey;
                            a &&
                              !t &&
                              u.getLogs({ id: i, uin: r }, function (t, n) {
                                t
                                  ? console.error(t)
                                  : e.send(
                                      {
                                        url: s + "/offlineLog",
                                        data: {
                                          logs: n,
                                          secretKey: a,
                                          id: i,
                                          uin: r,
                                          aid: o,
                                        },
                                        method: "post",
                                        type: A.OFFLINE,
                                        log: n,
                                      },
                                      function () {
                                        u.clearLogs();
                                      },
                                    );
                              });
                          },
                        );
                    });
                } catch (e) {
                  console.error(e);
                }
              else
                console.warn(
                  "[aegis-mp-sdk]unsupport getFileSystemManager offline log not work!",
                );
            },
          }),
          re =
            ((Re.prototype.getLogs = function (e, t) {
              var n = this.fileSystem,
                i = this.filePath;
              n.readFile({
                filePath: i,
                encoding: "utf8",
                fail: function (e) {
                  console.error(e);
                },
                success: function (e) {
                  (e = (void 0 === (e = e.data) ? "" : e)
                    .toString()
                    .split("\n")
                    .filter(function (e) {
                      return e;
                    })
                    .map(function (e) {
                      return JSON.parse(e);
                    })),
                    t(null, e);
                },
              });
            }),
            (Re.prototype.checkLimit = function (e, t) {
              void 0 === t && (t = function () {});
              var n = this.fileSystem,
                i = this.filePath,
                o = this.limitSize;
              n.readFile({
                filePath: i,
                encoding: "utf8",
                success: function (r) {
                  if (
                    (r = (r = void 0 === (r = r.data) ? "" : r).toString() + e)
                      .length > o
                  ) {
                    for (
                      var a = r.split("\n"), s = "", l = a.length - 1;
                      0 <= l && !(a[l] && (s = a[l] + "\n" + s).length > o);
                      l--
                    );
                    n.writeFile({ filePath: i, data: s, success: t });
                  } else
                    n.appendFile({
                      data: e,
                      filePath: i,
                      encoding: "utf8",
                      success: t,
                      fail: function (e) {
                        console.error(e);
                      },
                    });
                },
              });
            }),
            Re),
          ae = new te({
            name: "device",
            onNewAegis: function (e) {
              return (
                (t = this),
                (o = function () {
                  return (function (e, t) {
                    var n,
                      i,
                      o,
                      r = {
                        label: 0,
                        sent: function () {
                          if (1 & o[0]) throw o[1];
                          return o[1];
                        },
                        trys: [],
                        ops: [],
                      },
                      a = { next: s(0), throw: s(1), return: s(2) };
                    return (
                      "function" == typeof Symbol &&
                        (a[Symbol.iterator] = function () {
                          return this;
                        }),
                      a
                    );
                    function s(a) {
                      return function (s) {
                        var l = [a, s];
                        if (n)
                          throw new TypeError(
                            "Generator is already executing.",
                          );
                        for (; r; )
                          try {
                            if (
                              ((n = 1),
                              i &&
                                (o =
                                  2 & l[0]
                                    ? i.return
                                    : l[0]
                                      ? i.throw ||
                                        ((o = i.return) && o.call(i), 0)
                                      : i.next) &&
                                !(o = o.call(i, l[1])).done)
                            )
                              return o;
                            switch (
                              ((i = 0), (l = o ? [2 & l[0], o.value] : l)[0])
                            ) {
                              case 0:
                              case 1:
                                o = l;
                                break;
                              case 4:
                                return r.label++, { value: l[1], done: !1 };
                              case 5:
                                r.label++, (i = l[1]), (l = [0]);
                                continue;
                              case 7:
                                (l = r.ops.pop()), r.trys.pop();
                                continue;
                              default:
                                if (
                                  !(
                                    (o =
                                      0 < (o = r.trys).length &&
                                      o[o.length - 1]) ||
                                    (6 !== l[0] && 2 !== l[0])
                                  )
                                ) {
                                  r = 0;
                                  continue;
                                }
                                if (
                                  3 === l[0] &&
                                  (!o || (l[1] > o[0] && l[1] < o[3]))
                                )
                                  r.label = l[1];
                                else if (6 === l[0] && r.label < o[1])
                                  (r.label = o[1]), (o = l);
                                else {
                                  if (!(o && r.label < o[2])) {
                                    o[2] && r.ops.pop(), r.trys.pop();
                                    continue;
                                  }
                                  (r.label = o[2]), r.ops.push(l);
                                }
                            }
                            l = t.call(e, r);
                          } catch (s) {
                            (l = [6, s]), (i = 0);
                          } finally {
                            n = o = 0;
                          }
                        if (5 & l[0]) throw l[1];
                        return { value: l[0] ? l[1] : void 0, done: !0 };
                      };
                    }
                  })(this, function (t) {
                    return (
                      this.setSystemInfo(e),
                      this.setNetworkType(e),
                      this.setNetworkChange(e),
                      [2]
                    );
                  });
                }),
                new (i = (i = n = void 0) || Promise)(function (e, r) {
                  function a(e) {
                    try {
                      l(o.next(e));
                    } catch (e) {
                      r(e);
                    }
                  }
                  function s(e) {
                    try {
                      l(o.throw(e));
                    } catch (e) {
                      r(e);
                    }
                  }
                  function l(t) {
                    var n;
                    t.done
                      ? e(t.value)
                      : ((n = t.value) instanceof i
                          ? n
                          : new i(function (e) {
                              e(n);
                            })
                        ).then(a, s);
                  }
                  l((o = o.apply(t, n || [])).next());
                })
              );
              var t, n, i, o;
            },
            setSystemInfo: function (e) {
              var t = this;
              try {
                x("getSystemInfo") &&
                  ne.getSystemInfo({
                    success: function (n) {
                      var i = n.platform,
                        o = n.model,
                        r = n.windowHeight,
                        a = n.windowWidth,
                        s = void 0 === (s = n.screenWidth) ? 0 : s;
                      (n = void 0 === (n = n.screenHeight) ? 0 : n),
                        e.extendBean("platform", t.getPlatFormType(i)),
                        e.extendBean("model", o),
                        e.extendBean(
                          "vp",
                          Math.round(a) + " * " + Math.round(r),
                        ),
                        e.extendBean(
                          "sr",
                          Math.round(s) + " * " + Math.round(n),
                        );
                    },
                  });
              } catch (e) {}
            },
            getPlatFormType: function (e) {
              for (
                var t,
                  n = {
                    android: /android/i,
                    ios: /ios/i,
                    windows: /windows/i,
                    macos: /mac/i,
                    devtools: /devtools/i,
                  },
                  i = L.other,
                  o = 0;
                o < Object.keys(n).length;
                o++
              ) {
                var r = Object.keys(n)[o];
                if (null != (t = n[r]) && t.test(e)) {
                  i = L[r];
                  break;
                }
              }
              return i;
            },
            setNetworkChange: function (e) {
              x("onNetworkStatusChange") &&
                ne.onNetworkStatusChange(function (t) {
                  (t = T(t.networkType)), e.extendBean("netType", t);
                });
            },
            setNetworkType: function (e) {
              x("getNetworkType") &&
                ne.getNetworkType({
                  success: function (t) {
                    (t = T(t.networkType)), e.extendBean("netType", t);
                  },
                });
            },
          }),
          se = ne.request,
          le =
            (t(Ee, (H = ee)),
            Object.defineProperty(Ee.prototype, "getBean", {
              get: function () {
                var e = this;
                return this.bean
                  ? Object.getOwnPropertyNames(this.bean)
                      .map(function (t) {
                        return t + "=" + e.bean[t];
                      })
                      .join("&") +
                      "&from=" +
                      encodeURIComponent(w(this.config))
                  : "from=" + encodeURIComponent(w(this.config));
              },
              enumerable: !1,
              configurable: !0,
            }),
            (Ee.prototype.initOfflineLog = function () {
              Ee.use(oe);
            }),
            (Ee.prototype.initRequestSchedule = function () {
              this.requestSchedule = new S(this.sendRequest);
            }),
            (Ee.prototype.uploadLogs = function (e, t) {
              this.lifeCycle.emit(
                "uploadLogs",
                (e = void 0 === e ? {} : e),
                (t = void 0 === t ? {} : t),
              );
            }),
            (Ee.prototype.reportPv = function (e) {
              var t,
                n = this;
              e &&
                ((t =
                  Object.getOwnPropertyNames(this.bean)
                    .filter(function (e) {
                      return "id" !== e;
                    })
                    .map(function (e) {
                      return e + "=" + n.bean[e];
                    })
                    .join("&") +
                  "&from=" +
                  encodeURIComponent(w(this.config))),
                this.send(
                  {
                    url: this.config.url + "/" + e + "?" + t,
                    addBean: !1,
                    type: A.CUSTOM_PV,
                    log: A.CUSTOM_PV,
                  },
                  function () {},
                  function () {},
                ));
            }),
            (Ee.sessionID = "session-" + Date.now()),
            (Ee.asyncPluginIndex = 0),
            (ee = Ee),
            new te({
              name: "aid",
              onNewAegis: function (e) {
                this.initAid(function (t) {
                  (e.bean.aid = t), (e.config.aid = t);
                });
              },
              initAid: function (e) {
                ne.getStorage({
                  key: "AEGIS_ID",
                  success: function (t) {
                    e(t.data);
                  },
                  fail: function () {
                    var t = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
                      /[xy]/g,
                      function (e) {
                        var t = (16 * Math.random()) | 0;
                        return ("x" === e ? t : (3 & t) | 8).toString(16);
                      },
                    );
                    ne.setStorage({
                      key: "AEGIS_ID",
                      data: t,
                      success: function () {
                        e(t);
                      },
                    });
                  },
                });
              },
            })),
          ue =
            ((Oe.prototype.addCallback = function (e) {
              e && this.callbacks.push(e);
            }),
            (Oe.prototype.prefixHandler = function (e) {
              return i(i({}, e), { aegisRequestStartTime: +new Date() });
            }),
            (Oe.prototype.successHandler = function (e, t) {
              var n;
              this.callbacks.forEach(function (n) {
                var i;
                try {
                  null != (i = n.success) && i.call(n, e, t);
                } catch (n) {}
              }),
                null != (n = t.success) && n.call(t, e, t);
            }),
            (Oe.prototype.failHandler = function (e, t) {
              var n;
              this.callbacks.forEach(function (n) {
                var i;
                try {
                  null != (i = n.fail) && i.call(n, e, t);
                } catch (n) {}
              }),
                null != (n = t.fail) && n.call(t, e, t);
            }),
            (Oe.prototype.completeHandler = function (e, t) {
              var n;
              this.callbacks.forEach(function (n) {
                var i;
                try {
                  null != (i = n.complete) && i.call(n, e, t);
                } catch (n) {}
              }),
                null != (n = t.complete) && n.call(t, e, t);
            }),
            (Oe.prototype.override = function () {
              try {
                this.defineApiProperty();
              } catch (e) {
                console.warn(
                  "cannot override `" + this.apiName + "`, error is: " + e,
                );
              } finally {
                this.isOverride = !0;
              }
            }),
            Oe),
          ce = wx || qq,
          fe = {},
          pe =
            (t(be, (U = ue)),
            (be.prototype.defineApiProperty = function () {
              var e = this;
              ce.cloud &&
                ce.cloud[this.apiName] &&
                Object.defineProperty(ce.cloud, this.apiName, {
                  get: function () {
                    return e.hackHandler.bind(e);
                  },
                });
            }),
            (be.prototype.hackHandler = function (e) {
              var t = this,
                n = this.prefixHandler(e);
              return new Promise(function (e, o) {
                var r = null == (r = fe[t.apiName]) ? void 0 : r.originApi;
                null != r &&
                  r(
                    i(i({}, n), {
                      success: function (i) {
                        t.successHandler(i, n), e(i);
                      },
                      fail: function (e) {
                        t.failHandler(e, n), o(e);
                      },
                      complete: function (e) {
                        t.completeHandler(e, n);
                      },
                    }),
                  );
              });
            }),
            be),
          de = wx || qq,
          he = {},
          ge =
            (t(ye, (j = ue)),
            (ye.prototype.defineApiProperty = function () {
              var e = this;
              Object.defineProperty(de, this.apiName, {
                get: function () {
                  return e.hackHandler.bind(e);
                },
              });
            }),
            (ye.prototype.hackHandler = function (e) {
              var t = this,
                n = this.prefixHandler(e);
              return null ==
                (e = null == (e = he[this.apiName]) ? void 0 : e.originApi)
                ? void 0
                : e(
                    i(i({}, n), {
                      success: function (e) {
                        t.successHandler(e, n);
                      },
                      fail: function (e) {
                        t.failHandler(e, n);
                      },
                      complete: function (e) {
                        t.completeHandler(e, n);
                      },
                    }),
                  );
            }),
            ye),
          me = wx || qq,
          ve = me.request;
        function ye() {
          return (null !== j && j.apply(this, arguments)) || this;
        }
        function be() {
          return (null !== U && U.apply(this, arguments)) || this;
        }
        function Oe(e) {
          (this.callbacks = []), (this.isOverride = !1);
          var t = e.apiName;
          (this.apiName = t),
            this.isOverride || this.override(),
            this.callbacks.push(e);
        }
        function Ee(e) {
          var t,
            o,
            r = H.call(this, e) || this;
          (r.originRequest = se),
            (r.speedLogPipeline = E([
              ((o = r.config),
              function (e, t) {
                var n,
                  i,
                  r,
                  a = "number" == typeof o.repeat ? o.repeat : 60;
                !o.speedSample || a <= 0
                  ? t(e)
                  : ((n = (null == o ? void 0 : o.id) || "0"),
                    (i = $[n] || {}),
                    Array.isArray(e)
                      ? (r = e.filter(function (e) {
                          var t = !i[e.url] || i[e.url] < a;
                          return (
                            t
                              ? ((i[e.url] = 1 + ~~i[e.url]), ($[n] = i))
                              : z[n] || X(n),
                            t
                          );
                        })).length && t(r)
                      : !i[e.url] || i[e.url] < a
                        ? ((i[e.url] = 1 + ~~i[e.url]), ($[n] = i), t(e))
                        : z[n] || X(n));
              }),
              m(r),
              function (e, n) {
                x("getNetworkType")
                  ? ne.getNetworkType({
                      success: function (i) {
                        (i = T(i.networkType)),
                          t.extendBean("netType", i),
                          n(e);
                      },
                    })
                  : n(e);
              },
              function (e, t) {
                r.lifeCycle.emit("beforeReportSpeed", e);
                var n = r.config.beforeReportSpeed;
                if (
                  (e =
                    "function" == typeof n
                      ? e.filter(function (e) {
                          return !1 !== n(e);
                        })
                      : e).length
                )
                  return t(e);
              },
              y((t = r), A.SPEED),
              function (e, t) {
                t(
                  e.map(function (e) {
                    return void 0 !== e.payload && delete e.payload, e;
                  }),
                );
              },
              function (e) {
                var t, n, o, a;
                r.send({
                  url: "" + r.config.speedUrl,
                  method: "post",
                  data:
                    ((e = e),
                    (t = r.bean),
                    (o = { fetch: [], static: [], bridge: [] }),
                    (a = {}),
                    Array.isArray(e)
                      ? e.forEach(function (e) {
                          var t;
                          null != (t = o[e.type]) && t.push(e);
                        })
                      : null != (n = o[e.type]) && n.push(e),
                    (a.payload = JSON.stringify(i({ duration: o }, t))),
                    a),
                });
              },
            ])),
            (r.request = function (e, t, n) {
              e.url &&
                r.bean.id &&
                (!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/.test(String(r.bean.aid)) ||
                (x("getNetworkType") && void 0 === r.bean.netType)
                  ? r.requestSchedule.addTask({
                      options: e,
                      success: t,
                      fail: n,
                    })
                  : (r.requestSchedule.addTask({
                      options: e,
                      success: t,
                      fail: n,
                    }),
                    r.requestSchedule.fireTask()));
            }),
            (r.sendRequest = function (e, t, o) {
              var a,
                s,
                l,
                u = e.url,
                c =
                  void 0 ===
                  (r.config.whiteListUrl === u &&
                    ((a = t),
                    (t = function (e) {
                      null != a && a(JSON.stringify(e.data));
                    })),
                  (c = e.method))
                    ? "get"
                    : c,
                f =
                  (!1 !== e.addBean &&
                    (u =
                      u +
                      (-1 === (null == u ? void 0 : u.indexOf("?"))
                        ? "?"
                        : "&") +
                      r.getBean),
                  e),
                p = r.config.onBeforeRequest;
              return (f = p ? p(e, r) : f) && f.url
                ? ((p = r.config.enableHttp2 || !1),
                  "get" === c
                    ? ((c = u),
                      (s = f.data),
                      (u =
                        "string" != typeof c
                          ? ""
                          : "object" == n(s) && s
                            ? ((l = Object.getOwnPropertyNames(s)
                                .map(function (e) {
                                  var t = s[e];
                                  return (
                                    e +
                                    "=" +
                                    ("string" == typeof t
                                      ? encodeURIComponent(t)
                                      : encodeURIComponent(JSON.stringify(t)))
                                  );
                                })
                                .join("&")
                                .replace(/eval/gi, "evaI")),
                              c + (-1 === c.indexOf("?") ? "?" : "&") + l)
                            : c),
                      r.originRequest(
                        i(
                          {
                            url: u,
                            enableHttp2: p,
                            success: t,
                            fail: o,
                            complete: r.requestSchedule.complete,
                          },
                          e.requestConfig,
                        ),
                      ))
                    : ("string" == typeof f.data &&
                        (f.data = f.data.replace(/eval/gi, "evaI")),
                      r.originRequest(
                        i(
                          {
                            url: u,
                            enableHttp2: p,
                            header: f.contentType
                              ? { "content-type": f.contentType }
                              : void 0,
                            method: "POST",
                            data: f.data,
                            success: t,
                            fail: o,
                            complete: r.requestSchedule.complete,
                          },
                          e.requestConfig,
                        ),
                      )),
                  !0)
                : ((l = ""),
                  (f && f.url) ||
                    ((l =
                      "Sending request blocked. Please handle the parameters reasonably, options.url is necessary"),
                    console.log(l)),
                  null != o && o(l),
                  r.requestSchedule.complete(),
                  !1);
            });
          try {
            e.offlineLog && r.initOfflineLog(),
              r.initRequestSchedule(),
              r.init(e),
              r.extendBean("sessionId", Ee.sessionID),
              r.extendBean(
                "referer",
                (x("getLaunchOptionsSync")
                  ? ne.getLaunchOptionsSync()
                  : { scene: "" }
                ).scene || "",
              );
          } catch (e) {
            console.warn(e),
              console.log(
                "%cThe above error occurred in the process of initializing Aegis, which will affect your normal use of Aegis.\nIt is recommended that you contact us for feedback and thank you for your support.",
                "color: red",
              ),
              r.sendSDKError(e);
          }
          return r;
        }
        function Re(e) {
          var t,
            n,
            i = this,
            o =
              void 0 === (o = (e = void 0 === e ? {} : e).path)
                ? "/.aegis.offline.log"
                : o;
          (e = void 0 === (e = e.limit) ? 2e4 : e),
            (this.offlineBuffer = []),
            (this.insertLog =
              ((t = null),
              (n = []),
              function (e) {
                (n = n.concat(e)),
                  (t =
                    t ||
                    setTimeout(function () {
                      var e,
                        o = i.fileSystem,
                        r = i.filePath,
                        a =
                          n
                            .map(function (e) {
                              return JSON.stringify(e);
                            })
                            .join("\n") + "\n";
                      a &&
                        ((e = function (e) {
                          e
                            ? i.checkLimit(a, function () {
                                n = [];
                              })
                            : o.writeFile({
                                data: a,
                                filePath: r,
                                encoding: "utf8",
                                fail: function (e) {
                                  console.error(e);
                                },
                                success: function () {
                                  n = [];
                                },
                              });
                        }),
                        o.access({
                          path: r,
                          success: function () {
                            e(!0);
                          },
                          fail: function () {
                            e();
                          },
                        })),
                        clearTimeout(t),
                        (t = null);
                    }, 2e3));
              })),
            (this.ready = function (e) {
              i.fileSystem
                ? setTimeout(function () {
                    e(null);
                  }, 0)
                : (e(new Error("getFileSystemManager file")),
                  (i.offlineLog = !1));
            }),
            (this.clearLogs = function () {
              var e = i.fileSystem,
                t = i.filePath;
              e.writeFile({
                filePath: t,
                data: "",
                fail: function () {
                  e.unlinkSync(t);
                },
              });
            }),
            (this.save2Offline = function (e, t) {
              (e = (e = Array.isArray(e) ? e : [e]).map(function (e) {
                return (
                  "string" == typeof e && (e = { msg: e }),
                  (function () {
                    for (var e = [], t = 0; t < arguments.length; t++)
                      e[t] = arguments[t];
                    if (0 === e.length)
                      throw new TypeError(
                        "Cannot convert undefined or null to object",
                      );
                    for (var n = Object(e[0]), i = 1; i < e.length; i++) {
                      var o = e[i];
                      if (null !== o)
                        for (var r in o)
                          Object.prototype.hasOwnProperty.call(o, r) &&
                            (n[r] = o[r]);
                    }
                    return n;
                  })(
                    {
                      id: t.id,
                      uin: t.uin,
                      time: +Date.now(),
                      version: t.version,
                      from: w(t),
                    },
                    e,
                  )
                );
              })),
                i.fileSystem
                  ? i.insertLog(e)
                  : (i.fileSystem ||
                      i.offlineBuffer.length ||
                      i.ready(function (e) {
                        e
                          ? console.error(e)
                          : i.offlineBuffer.length &&
                            (i.addLogs(i.offlineBuffer),
                            (i.offlineBuffer = []));
                      }),
                    (i.offlineBuffer = i.offlineBuffer.concat(e)));
            }),
            (this.addLogs = function (e) {
              i.fileSystem && i.insertLog(e);
            }),
            (this.filePath = ne.env.USER_DATA_PATH + o),
            (this.fileSystem = ne.getFileSystemManager()),
            (this.limitSize = e);
        }
        function we(e) {
          (this.aegisPlugin = !0),
            (this.name = ""),
            (this.instances = []),
            (this.inited = !1),
            (e.$walk = this.walk.bind(this)),
            (e.$getConfig = this.getConfig.bind(this)),
            (this.option = e),
            (this.name = e.name);
        }
        function Pe(e) {
          var t,
            n,
            i,
            o,
            r,
            a,
            s,
            u,
            c,
            f,
            p,
            d,
            h,
            g,
            y = this;
          (this.isGetSample = !1),
            (this.isHidden = !1),
            (this.config = {
              version: 0,
              delay: 1e3,
              onError: !0,
              repeat: 60,
              random: 1,
              aid: !0,
              device: !0,
              pagePerformance: !0,
              webVitals: !0,
              speedSample: !0,
              onClose: !0,
              reportLoadPackageSpeed: !0,
              hostUrl: "https://aegis.qq.com",
              env: "production",
              url: "",
              offlineUrl: "",
              whiteListUrl: "",
              pvUrl: "",
              speedUrl: "",
              customTimeUrl: "",
              performanceUrl: "",
              webVitalsUrl: "",
              eventUrl: "",
              setDataReportUrl: "",
              reportImmediately: !0,
            }),
            (this.isWhiteList = !1),
            (this.lifeCycle = new l()),
            (this.bean = {}),
            (this.normalLogPipeline = E([
              m(this, 5),
              v,
              function (e, n) {
                var i = t.config;
                n(
                  (e = e.map(function (e) {
                    var t,
                      n = i.maxLength || 102400;
                    try {
                      if (!e.msg || e.msg.length <= n) return e;
                      e.msg = null == (t = e.msg) ? void 0 : t.substring(0, n);
                    } catch (t) {
                      e.msg = F(e.msg).substring(0, i.maxLength);
                    }
                    return e;
                  })),
                );
              },
              ((g = (t = this).config),
              function (e, t) {
                var n = "number" == typeof g.repeat ? g.repeat : 60;
                if (n <= 0) return t(e);
                var i = (null == g ? void 0 : g.id) + "_error",
                  o = $[i] || {};
                t(
                  e.filter(function (e) {
                    if (
                      e.level === N.ERROR ||
                      e.level === N.PROMISE_ERROR ||
                      e.level === N.AJAX_ERROR ||
                      e.level === N.SCRIPT_ERROR ||
                      e.level === N.IMAGE_ERROR ||
                      e.level === N.CSS_ERROR ||
                      e.level === N.MEDIA_ERROR ||
                      e.level === N.RET_ERROR ||
                      e.level === N.BRIDGE_ERROR ||
                      e.level === N.PAGE_NOT_FOUND_ERROR ||
                      e.level === N.WEBSOCKET_ERROR ||
                      e.level === N.LAZY_LOAD_ERROR
                    ) {
                      if (((e = e.msg.slice(0, 200)), o[e] > n))
                        return z[i] || X(i), !1;
                      (o[e] = 1 + ~~o[e]), ($[i] = o);
                    }
                    return !0;
                  }),
                );
              }),
              ((d = this.lifeCycle.emit),
              (h = this.config),
              function (e, t) {
                var n,
                  i = h.logCreated;
                return "function" == typeof i
                  ? ((n = e.filter(function (e) {
                      return !1 !== i(e);
                    })),
                    d("beforeWrite", n),
                    t(n))
                  : (d("beforeWrite", e), t(e));
              }),
              ((p = this),
              setTimeout(function () {
                var e = void 0 === (t = (n = p.config).pvUrl) ? "" : t,
                  t = n.spa,
                  n = -1 < ["web-sdk", "mp-sdk"].indexOf("mp-sdk");
                e &&
                  ((n && !t) || !n) &&
                  p.sendPipeline(
                    [
                      function (t, n) {
                        n({ url: e, type: A.PV });
                      },
                    ],
                    A.PV,
                  )(null);
              }, 100),
              function (e, t) {
                t(e);
              }),
              ((c = u = s = !1),
              (f = []),
              (r = this).lifeCycle.on("onConfigChange", function () {
                a && clearTimeout(a),
                  (a = setTimeout(
                    function () {
                      var e, t;
                      !c &&
                        r.config &&
                        ((c = !0),
                        (e = r.config.whiteListUrl),
                        (t = void 0 === e ? "" : e) &&
                          r.sendPipeline(
                            [
                              function (e, n) {
                                n({
                                  url: t,
                                  type: A.WHITE_LIST,
                                  success: function (e) {
                                    u = !0;
                                    try {
                                      var t = e.data || JSON.parse(e),
                                        n = t.retcode,
                                        i = t.result,
                                        o = void 0 === i ? {} : i,
                                        a =
                                          (0 === n &&
                                            ((s = o.is_in_white_list),
                                            (r.isWhiteList = s),
                                            0 <= o.rate) &&
                                            o.rate <= 1 &&
                                            ((r.config.random = o.rate),
                                            (r.isGetSample = !1)),
                                          r.isWhiteList && f.length
                                            ? Q(r)(f.splice(0), function () {})
                                            : !r.isWhiteList &&
                                              f.length &&
                                              (f.length = 0),
                                          r.config.onWhitelist);
                                      "function" == typeof a && a(s);
                                    } catch (e) {}
                                  },
                                  fail: function () {
                                    u = !0;
                                  },
                                });
                              },
                            ],
                            A.WHITE_LIST,
                          )(null),
                        (c = !1));
                    },
                    r.config.uin ? 50 : 500,
                  ));
              }),
              r.lifeCycle.on("destroy", function () {
                f.length = 0;
              }),
              function (e, t) {
                var n;
                s ||
                (null != (n = null == (n = r.config) ? void 0 : n.api) &&
                  n.reportRequest)
                  ? t(
                      e.concat(f.splice(0)).map(function (e) {
                        return K(e), e;
                      }),
                    )
                  : (n = e.filter(function (e) {
                      return e.level !== N.INFO && e.level !== N.API_RESPONSE
                        ? (K(e), !0)
                        : (u ||
                            (f.push(e), 200 <= f.length && (f.length = 200)),
                          !1);
                    })).length && t(n);
              }),
              function (e, t) {
                try {
                  var n = JSON.parse(JSON.stringify(e)),
                    i =
                      (y.lifeCycle.emit("beforeReport", n),
                      y.config.beforeReport);
                  (e =
                    "function" == typeof i
                      ? e.filter(function (e) {
                          return !1 !== i(e);
                        })
                      : e).length && t(e);
                } catch (e) {}
              },
              Q(this),
            ])),
            (this.eventPipeline = E([
              m(this, 10),
              ((o = this),
              function (e) {
                o.sendPipeline(
                  [
                    function (e, t) {
                      var n = e.map(function (e) {
                        return {
                          name: e.name,
                          ext1: e.ext1 || o.config.ext1 || "",
                          ext2: e.ext2 || o.config.ext2 || "",
                          ext3: e.ext3 || o.config.ext3 || "",
                        };
                      });
                      t({
                        url:
                          o.config.eventUrl +
                          "?payload=" +
                          encodeURIComponent(JSON.stringify(n)),
                        type: A.EVENT,
                        log: e,
                      });
                    },
                  ],
                  A.EVENT,
                )(e);
              }),
            ])),
            (this.timeMap = {}),
            (this.failRequestCount = 0),
            (this.customTimePipeline = E([
              m(this, 10),
              ((i = this),
              function (e) {
                return i.sendPipeline(
                  [
                    function (e, t) {
                      t({
                        url:
                          i.config.customTimeUrl +
                          "?payload=" +
                          encodeURIComponent(JSON.stringify({ custom: e })),
                        type: A.CUSTOM,
                        log: e,
                      });
                    },
                  ],
                  A.CUSTOM,
                )(e);
              }),
            ])),
            (this.config =
              ((n = this.config),
              void 0 === (e = e.hostUrl) && (e = "https://aegis.qq.com"),
              (n.url = n.url || e + "/collect"),
              (n.offlineUrl = n.offlineUrl || e + "/offline"),
              (n.whiteListUrl = n.whiteListUrl || e + "/collect/whitelist"),
              (n.pvUrl = n.pvUrl || e + "/collect/pv"),
              (n.eventUrl = n.eventUrl || e + "/collect/events"),
              (n.speedUrl = n.speedUrl || e + "/speed"),
              (n.customTimeUrl = n.customTimeUrl || e + "/speed/custom"),
              (n.performanceUrl = n.performanceUrl || e + "/speed/performance"),
              (n.webVitalsUrl = n.webVitalsUrl || e + "/speed/webvitals"),
              (n.setDataReportUrl =
                n.SetDataReportUrl || e + "/speed/miniProgramData"),
              n)),
            Pe.instances.push(this);
        }
        function Se() {
          return (null !== I && I.apply(this, arguments)) || this;
        }
        function xe(e, t, i) {
          return null != t && t.length && "object" == n(e)
            ? t.reduce(function (t, n) {
                var o = e[n];
                return o
                  ? t +
                      ("" === t ? "\n" : "\n\n") +
                      i +
                      " header " +
                      n +
                      ": " +
                      o
                  : t;
              }, "")
            : "";
        }
        t(Se, (I = ue)),
          (Se.prototype.defineApiProperty = function () {
            var e = this;
            Object.defineProperty(me, "request", {
              get: function () {
                return e.hackHandler.bind(e);
              },
            });
          });
        var Te,
          ke,
          Ce = new te({
            name: "reportApiSpeed",
            override: !(Se.prototype.hackHandler = function (e) {
              var t = this,
                n = this.prefixHandler(e);
              return ve(
                i(i({}, n), {
                  success: function (e) {
                    t.successHandler(e, n);
                  },
                  fail: function (e) {
                    t.failHandler(e, n);
                  },
                  complete: function (e) {
                    t.completeHandler(e, n);
                  },
                }),
              );
            }),
            onNewAegis: function (e) {
              this.override ||
                ((this.override = !0),
                this.hackRequest(e.config),
                this.overrideCallFunction(e.config),
                this.overrideCallContainer(e.config));
            },
            hackRequest: function (e) {
              var t = this;
              C({
                apiName: "request",
                success: function (n, i) {
                  var o, r, a, s, l, u, c;
                  g(i.url, e.hostUrl) ||
                    ((o = {
                      method: i.method || "get",
                      url: f(i.url),
                      duration: Date.now() - i.aegisRequestStartTime,
                      status: n.statusCode || 0,
                      nextHopProtocol: "",
                      isHttps: p(i.url),
                      type: "fetch",
                    }),
                    (s = null == (s = e.api) ? void 0 : s.apiDetail),
                    (r = (a =
                      d(n.data, e.api, {
                        url: i.url,
                        ctx: n,
                        payload: i.data,
                      }) || {}).code),
                    (a = a.isErr),
                    (c = s
                      ? h(
                          i.data,
                          null == (c = e.api) ? void 0 : c.reqParamHandler,
                          { url: i.url },
                        )
                      : ""),
                    (s = s
                      ? h(
                          n.data,
                          null == (s = e.api) ? void 0 : s.resBodyHandler,
                          { url: i.url },
                        )
                      : ""),
                    (l = (null == (l = e.api) ? void 0 : l.reqHeaders) || []),
                    (l = xe(null == i ? void 0 : i.header, l, "req")),
                    (u = (null == (u = e.api) ? void 0 : u.resHeaders) || []),
                    (u = xe(null == n ? void 0 : n.header, u, "res")),
                    (c =
                      "req url: " +
                      o.url +
                      " \n                        \nres status: " +
                      (n.statusCode || 0) +
                      " \n                        \nres duration: " +
                      o.duration +
                      "ms \n                        \nreq method: " +
                      o.method +
                      " \n                        \nreq param: " +
                      c +
                      "  \n                        \nres retcode: " +
                      r +
                      " \n                        \nres data: " +
                      s +
                      "\n                        " +
                      l +
                      "\n                        " +
                      u),
                    t.publishNormalLog({
                      msg: c,
                      level: N.API_RESPONSE,
                      ctx: n,
                    }),
                    (o.ret = r),
                    (o.isErr = +a),
                    (o.payload = i.data),
                    t.publishSpeedLog(o),
                    a &&
                      t.publishNormalLog({
                        msg: c,
                        level: N.RET_ERROR,
                        ctx: n,
                      }));
                },
                fail: function (n, i) {
                  g(i.url, e.hostUrl) ||
                    ((i = {
                      method: i.method || "get",
                      url: f(i.url),
                      duration: Date.now() - i.aegisRequestStartTime,
                      status: 0,
                      nextHopProtocol: "",
                      isHttps: p(i.url),
                      type: "fetch",
                    }),
                    t.publishSpeedLog(i));
                },
              });
            },
            overrideCallFunction: function (e) {
              var t = this;
              k({
                apiName: "callFunction",
                success: function (n, i) {
                  t.cloudSuccessCallback(e, i, n, "callFunction");
                },
                fail: function (e, n) {
                  (n = {
                    method: "call",
                    url: "wx.cloud.callFunction." + n.name,
                    duration: Date.now() - n.aegisRequestStartTime,
                    status: 0,
                    nextHopProtocol: "",
                    type: "fetch",
                    errMsg: e.errMsg,
                    isHttps: !0,
                  }),
                    t.publishSpeedLog(n);
                },
              });
            },
            overrideCallContainer: function (e) {
              var t = this;
              k({
                apiName: "callContainer",
                success: function (n, i) {
                  t.cloudSuccessCallback(e, i, n, "callContainer");
                },
                fail: function (e, n) {
                  (n = {
                    method: "call",
                    url: "wx.cloud.callContainer." + n.path,
                    duration: Date.now() - n.aegisRequestStartTime,
                    status: 0,
                    nextHopProtocol: "",
                    type: "fetch",
                    errMsg: e.errMsg,
                    isHttps: !0,
                  }),
                    t.publishSpeedLog(n);
                },
              });
            },
            cloudSuccessCallback: function (e, t, n, i) {
              var o = "callFunction" === i ? t.name : t.path,
                r = "callFunction" === i ? n.result : n.data,
                a =
                  ((o = {
                    method: "call",
                    url: "wx.cloud." + i + "." + o,
                    duration: Date.now() - t.aegisRequestStartTime,
                    status: 200,
                    nextHopProtocol: "",
                    type: "fetch",
                    isHttps: !0,
                  }),
                  [
                    "apiName",
                    "aegisRequestStartTime",
                    "config",
                    "success",
                    "fail",
                    "complete",
                  ]),
                s = Object.keys(t).reduce(function (e, n) {
                  return a.includes(n) || (e[n] = t[n]), e;
                }, {}),
                l =
                  ((i =
                    "callFunction" === i
                      ? (null == (i = n.data) ? void 0 : i.code) || 0
                      : n.statusCode),
                  (u = d(r, e.api, { url: o.url, ctx: n, payload: s }) || {})
                    .code),
                u = void 0 !== (u = u.isErr) && u;
              (o.ret = l),
                (o.isErr = +u),
                (o.payload = s),
                (s = (l = null == (l = e.api) ? void 0 : l.apiDetail)
                  ? h(s, null == (s = e.api) ? void 0 : s.reqParamHandler, {
                      url: o.url,
                    })
                  : ""),
                (r = l
                  ? h(r, null == (l = e.api) ? void 0 : l.resBodyHandler, {
                      url: o.url,
                    })
                  : ""),
                (l = (null == (l = e.api) ? void 0 : l.reqHeaders) || []),
                (l = xe(null == t ? void 0 : t.header, l, "req")),
                (e = (null == (e = e.api) ? void 0 : e.resHeaders) || []),
                (e = xe(null == n ? void 0 : n.header, e, "res")),
                (i =
                  "req url: " +
                  o.url +
                  "\n                    \nres status: " +
                  i +
                  "\n                    \nres duration: " +
                  o.duration +
                  "ms \n                    \nreq type: " +
                  o.type +
                  "\n                    \nreq params: " +
                  s +
                  "\n                    \nres retcode: " +
                  o.ret +
                  "\n                    \nres data: " +
                  r +
                  "\n                    " +
                  l +
                  "\n                    " +
                  e),
                this.publishNormalLog({
                  msg: i,
                  level: N.API_RESPONSE,
                  ctx: n,
                }),
                this.publishSpeedLog(o),
                u &&
                  this.publishNormalLog({ msg: i, level: N.RET_ERROR, ctx: n });
            },
            publishSpeedLog: function (e) {
              this.$walk(function (t) {
                t.speedLogPipeline(e);
              });
            },
            publishNormalLog: function (e) {
              this.$walk(function (t) {
                t.normalLogPipeline(e);
              });
            },
          }),
          Ne = wx || qq,
          Le = Ne.connectSocket,
          qe =
            ((Ie.prototype.addConfig = function (e) {
              var t = e.send;
              (e = e.onError),
                t && this.sends.push(t),
                e && this.onErrors.push(e);
            }),
            (Ie.prototype.toHack = function (e) {
              var t = this,
                n =
                  (this.onErrors.forEach(function (t) {
                    e.onError(t);
                  }),
                  e.send);
              return (
                Object.defineProperty(e, "send", {
                  get: function () {
                    return function (o) {
                      return new Promise(function (r) {
                        n.call(
                          e,
                          i(i({}, o), {
                            fail: function (e) {
                              t.sends.forEach(function (t) {
                                var n;
                                null != (n = t.fail) && n.call(t, e, o);
                              }),
                                r(e);
                            },
                          }),
                        );
                      });
                    };
                  },
                }),
                e
              );
            }),
            Ie),
          Ae =
            (t(He, (ke = ue)),
            (He.prototype.addTaskConf = function (e) {
              this.taskHack.addConfig(e);
            }),
            (He.prototype.defineApiProperty = function () {
              var e = this;
              Object.defineProperty(Ne, "connectSocket", {
                get: function () {
                  return e.hackHandler.bind(e);
                },
              });
            }),
            (He.prototype.hackHandler = function (e) {
              var t = this,
                n = this.prefixHandler(e);
              return (
                (e = Le(
                  i(i({}, n), {
                    success: function (e) {
                      t.successHandler(e, n);
                    },
                    fail: function (e) {
                      t.failHandler(e, n);
                    },
                    complete: function (e) {
                      t.completeHandler(e, n);
                    },
                  }),
                )),
                this.taskHack.toHack(e),
                e
              );
            }),
            He),
          _e =
            ((ue = new te({
              name: "onError",
              onNewAegis: function (e) {
                var t = ne.getSystemInfoSync().SDKVersion;
                this.listenError(),
                  this.hackNetWork(e),
                  this.hackCloud(e),
                  e.config.websocketHack &&
                    P(t, "1.7.0") &&
                    this.hackWsConnect();
              },
              listenError: function () {
                var e = this;
                "function" == typeof ne.onError &&
                  ne.onError(function (t) {
                    t && e.publishErrorLog({ msg: t, level: N.ERROR });
                  }),
                  x("onUnhandledRejection") &&
                    ne.onUnhandledRejection(function (t) {
                      !(t = t.reason) ||
                        -1 < JSON.stringify(t).indexOf("request:fail") ||
                        e.publishErrorLog({ msg: t, level: N.PROMISE_ERROR });
                    }),
                  x("onPageNotFound") &&
                    ne.onPageNotFound(function (t) {
                      t &&
                        e.publishErrorLog({
                          msg: t,
                          level: N.PAGE_NOT_FOUND_ERROR,
                        });
                    }),
                  x("onLazyLoadError") &&
                    ne.onLazyLoadError(function (t) {
                      t &&
                        e.publishErrorLog({ msg: t, level: N.LAZY_LOAD_ERROR });
                    });
              },
              publishErrorLog: function (e) {
                this.$walk(function (t) {
                  t.normalLogPipeline(e);
                });
              },
              hackNetWork: function (e) {
                for (
                  var t = this,
                    n = e.config,
                    i = 0,
                    o = [
                      {
                        apiName: "request",
                        complete: function (e, i) {
                          return t.requestCompleteError(e, i, n);
                        },
                      },
                      {
                        apiName: "uploadFile",
                        complete: function (e, i) {
                          return t.uploadFileCompleteError(e, i, n);
                        },
                      },
                      {
                        apiName: "downloadFile",
                        complete: function (e, i) {
                          return t.downloadFileCompleteError(e, i, n);
                        },
                      },
                    ];
                  i < o.length;
                  i++
                ) {
                  var r;
                  C({
                    apiName: (r = o[i]).apiName,
                    complete: (r = r.complete),
                  });
                }
              },
              requestCompleteError: function (e, t, n) {
                var i = e.errMsg,
                  o = e.statusCode;
                g(t.url, n.hostUrl) ||
                  ((i = this.getErrorType({ errMsg: i, statusCode: o })) &&
                    this.publishNetWorkError({
                      apiName: "request",
                      opts: t,
                      res: e,
                      config: n,
                      type: i,
                    }));
              },
              downloadFileCompleteError: function (e, t, n) {
                var i,
                  o = e.errMsg,
                  r = e.statusCode,
                  a = e.filePath,
                  s =
                    ((e = e.tempFilePath),
                    this.getErrorType({ errMsg: o, statusCode: r }));
                s &&
                  ((n =
                    null != (i = n.api) && i.apiDetail
                      ? h(
                          t.data,
                          null == (i = n.api) ? void 0 : i.reqParamHandler,
                          { url: t.url },
                        )
                      : ""),
                  this.publishErrorLog({
                    msg:
                      "AJAX_ERROR: downloadFile " +
                      s +
                      "\n                  \nreq url: " +
                      t.url +
                      "\n                  \nres status: " +
                      (r || 0) +
                      "\n                  \nres duration: " +
                      (Date.now() - t.aegisRequestStartTime) +
                      "ms\n                  \nres filePath: " +
                      a +
                      "\n                  \nres tempFilePath: " +
                      e +
                      "\n                  \nreq method: " +
                      (t.method || "get") +
                      "\n                  \nreq param: " +
                      n +
                      "\n                  \nerrMsg: " +
                      o.slice(0, 1e3),
                    level: N.AJAX_ERROR,
                  }));
              },
              uploadFileCompleteError: function (e, t, n) {
                var i = e.errMsg,
                  o = e.statusCode;
                (i = this.getErrorType({ errMsg: i, statusCode: o })) &&
                  this.publishNetWorkError({
                    apiName: "uploadFile",
                    opts: t,
                    res: e,
                    config: n,
                    type: i,
                  });
              },
              hackCloud: function (e) {
                for (
                  var t = this,
                    n = e.config,
                    i = 0,
                    o = [
                      {
                        apiName: "callFunction",
                        complete: function (e, i) {
                          return t.callFunctionCompleteError(e, i, n);
                        },
                      },
                      {
                        apiName: "callContainer",
                        complete: function (e, i) {
                          return t.callContainerCompleteError(e, i, n);
                        },
                      },
                    ];
                  i < o.length;
                  i++
                ) {
                  var r;
                  k({
                    apiName: (r = o[i]).apiName,
                    complete: (r = r.complete),
                  });
                }
              },
              callFunctionCompleteError: function (e, t, n) {
                var i, o;
                (-1 < e.errMsg.indexOf("fail") ||
                  -1 < e.errMsg.indexOf("timeout")) &&
                  ((o = (i = null == (i = n.api) ? void 0 : i.apiDetail)
                    ? h(
                        t.data,
                        null == (o = n.api) ? void 0 : o.reqParamHandler,
                        { url: null == t ? void 0 : t.url },
                      )
                    : ""),
                  (n = i
                    ? h(e, null == (i = n.api) ? void 0 : i.resBodyHandler, {
                        url: null == t ? void 0 : t.url,
                      })
                    : ""),
                  this.publishErrorLog({
                    msg:
                      "AJAX_ERROR: cloud.callFunction:fail\n                    \nreq url: cloud.callFunction." +
                      t.name +
                      "\n                    \nres status: 0\n                    \nres duration: " +
                      (Date.now() - t.aegisRequestStartTime) +
                      "ms\n                    \nres data: " +
                      n +
                      "\n                    \nreq method: POST\n                    \nreq param: " +
                      o +
                      "\n                    \nerrMsg: " +
                      e.errMsg.slice(0, 1e3),
                    level: N.AJAX_ERROR,
                  }));
              },
              callContainerCompleteError: function (e, t, n) {
                var i,
                  o,
                  r,
                  a = e.errMsg,
                  s = e.statusCode;
                (400 <= s ||
                  -1 < a.indexOf("fail") ||
                  -1 < a.indexOf("timeout")) &&
                  ((i = (o = null == (o = n.api) ? void 0 : o.apiDetail)
                    ? h(
                        t.data,
                        null == (i = n.api) ? void 0 : i.reqParamHandler,
                        { url: null == t ? void 0 : t.url },
                      )
                    : ""),
                  (o = o
                    ? h(e, null == (o = n.api) ? void 0 : o.resBodyHandler, {
                        url: null == t ? void 0 : t.url,
                      })
                    : ""),
                  (r = (null == (r = n.api) ? void 0 : r.reqHeaders) || []),
                  (r = xe(null == t ? void 0 : t.header, r, "req")),
                  (n = (null == (n = n.api) ? void 0 : n.resHeaders) || []),
                  (e = xe(null == e ? void 0 : e.header, n, "res")),
                  this.publishErrorLog({
                    msg:
                      "AJAX_ERROR: cloud.callContainer:fail\n                    \nreq url: " +
                      t.path +
                      "\n                    \nres status: " +
                      (s || 0) +
                      "\n                    \nres duration: " +
                      (Date.now() - t.aegisRequestStartTime) +
                      "ms\n                    \nreq method: " +
                      (t.method || "POST") +
                      "\n                    \nreq param: " +
                      i +
                      "\n                    \nres data: " +
                      o +
                      "\n                    \nerrMsg: " +
                      a.slice(0, 1e3) +
                      "\n                    " +
                      r +
                      "\n                    " +
                      e,
                    level: N.AJAX_ERROR,
                  }));
              },
              publishNetWorkError: function (e) {
                var t = e.apiName,
                  n = e.opts,
                  i = e.res,
                  o = e.config,
                  r = ((e = e.type), i.errMsg),
                  a = i.statusCode,
                  s = i.data,
                  l = "wx.cloud.callFunction." + n.url,
                  u = d(s, o.api, { url: l, ctx: i, payload: n.data }).code,
                  c = (f = null == (f = o.api) ? void 0 : f.apiDetail)
                    ? h(
                        n.data,
                        null == (c = o.api) ? void 0 : c.reqParamHandler,
                        { url: l },
                      )
                    : "",
                  f =
                    ((s = f
                      ? h(s, null == (f = o.api) ? void 0 : f.resBodyHandler, {
                          url: l,
                        })
                      : ""),
                    (l = (null == (f = o.api) ? void 0 : f.reqHeaders) || []),
                    xe(null == n ? void 0 : n.header, l, "req"));
                (o = (null == (l = o.api) ? void 0 : l.resHeaders) || []),
                  (l = xe(null == i ? void 0 : i.header, o, "res")),
                  this.publishErrorLog({
                    msg:
                      "AJAX_ERROR: " +
                      t +
                      " " +
                      e +
                      "\n                  \nreq url: " +
                      n.url +
                      "\n                  \nres status: " +
                      (a || 0) +
                      "\n                  \nres duration: " +
                      (Date.now() - n.aegisRequestStartTime) +
                      "ms\n                  \nreq method: " +
                      (n.method || "get") +
                      "\n                  \nreq param: " +
                      c +
                      "\n                  \nres retcode: " +
                      u +
                      "\n                  \nres data: " +
                      s +
                      "\n                  \nerrMsg: " +
                      r.slice(0, 1e3) +
                      "\n                  " +
                      f +
                      "\n                  " +
                      l,
                    level: N.AJAX_ERROR,
                  });
              },
              getErrorType: function (e) {
                var t = e.errMsg,
                  n = ((e = e.statusCode), ""),
                  i = t;
                return (
                  [
                    "timeout",
                    "time out",
                    "ERR_CONNECTION_TIMED_OUT",
                    "ERR_TIMED_OUT",
                    "超时",
                  ].some(function (e) {
                    return String(i || "").includes(e);
                  })
                    ? (n = "timeout")
                    : 400 <= e
                      ? (n = "error")
                      : (-1 < t.indexOf("fail") || !e || e < 0) &&
                        (n = "failed"),
                  n
                );
              },
              hackWsConnect: function () {
                var e,
                  t,
                  n = this;
                C({
                  apiName: "sendSocketMessage",
                  fail: function (e) {
                    n.publishSocketError(e);
                  },
                }),
                  (e = (t = {
                    connectCallback: {
                      fail: function (e) {
                        n.publishSocketError(e);
                      },
                    },
                    taskOpt: {
                      onError: function (e) {
                        n.publishSocketError(e);
                      },
                      send: {
                        fail: function (e) {
                          n.publishSocketError(e);
                        },
                      },
                    },
                  }).connectCallback),
                  (t = t.taskOpt),
                  Te ? Te.addCallback(e) : (Te = new Ae(e)),
                  t && Te.addTaskConf(t);
              },
              publishSocketError: function (e) {
                e &&
                  this.publishErrorLog({
                    msg: e.errMsg,
                    level: N.WEBSOCKET_ERROR,
                  });
              },
            })),
            new te({
              name: "reportAssetSpeed",
              isStart: !1,
              onNewAegis: function (e) {
                this.isStart || ((this.isStart = !0), this.start(e));
              },
              start: function (e) {
                var t = this;
                ne.getPerformance &&
                  ne
                    .getPerformance()
                    .createObserver(function (n) {
                      null != (n = n.getEntries()) &&
                        n.forEach(function (n) {
                          g(n.uri, e.config.hostUrl) ||
                            "number" != typeof n.duration ||
                            n.duration <= 0 ||
                            t.publishAssetLog(n);
                        });
                    })
                    .observe({ entryTypes: ["resource"] });
              },
              generateLog: function (e) {
                var t,
                  n,
                  i = e.transferSize;
                return {
                  url:
                    ((t = e.uri),
                    void 0 === n && (n = 2048),
                    String(t).replace(r, "").slice(0, n)),
                  method: "get",
                  duration: Math.round(100 * e.duration) / 100,
                  status: 200,
                  type: "static",
                  isHttps: !0,
                  urlQuery: f(e.uri, !0),
                  nextHopProtocol: "",
                  domainLookup: 0,
                  connectTime: 0,
                  transferSize: 0 < i ? i : -1,
                };
              },
              publishAssetLog: function (e) {
                var t = this;
                this.$walk(function (n) {
                  n.speedLogPipeline(t.generateLog(e));
                });
              },
            })),
          je = [
            "onLaunch",
            "onHide",
            "onError",
            "onLoad",
            "onReady",
            "onShow",
            "onUnload",
          ],
          Ue = new te({
            name: "pagePerformance",
            pageNavigationStartTime: {},
            onNewAegis: function (e) {
              try {
                x("getPerformance") && this.reportPerformance(e),
                  this.setPagePV(e),
                  this.reportSetDataTiming(e);
              } catch (e) {}
            },
            reportPerformance: function (e) {
              var t,
                n = this;
              null !=
                (t =
                  null == (t = ne.getPerformance())
                    ? void 0
                    : t.createObserver(function (t) {
                        var i = {},
                          o =
                            null == (o = t.getEntriesByName("appLaunch"))
                              ? void 0
                              : o[0],
                          r =
                            null == (r = t.getEntriesByName("firstRender"))
                              ? void 0
                              : r[0],
                          a =
                            null == (a = t.getEntriesByName("evaluateScript"))
                              ? void 0
                              : a[0],
                          s =
                            null == (s = t.getEntriesByName("route"))
                              ? void 0
                              : s[0],
                          l =
                            null ==
                            (l =
                              null == (l = t.getEntriesByName("firstPaint"))
                                ? void 0
                                : l[0])
                              ? void 0
                              : l.startTime,
                          u =
                            null ==
                            (u =
                              null ==
                              (u = t.getEntriesByName("largestContentfulPaint"))
                                ? void 0
                                : u[0])
                              ? void 0
                              : u.startTime,
                          c =
                            null ==
                            (c =
                              null ==
                              (c = t.getEntriesByName("firstContentfulPaint"))
                                ? void 0
                                : c[0])
                              ? void 0
                              : c.startTime,
                          f =
                            null ==
                            (f =
                              (null == (f = t.getEntriesByName("firstPaint"))
                                ? void 0
                                : f[0]) ||
                              (null == (f = t.getEntriesByName("route"))
                                ? void 0
                                : f[0]) ||
                              (null == (f = t.getEntriesByName("appLaunch"))
                                ? void 0
                                : f[0]))
                              ? void 0
                              : f.pageId,
                          p =
                            null ==
                            (t =
                              (null == (p = t.getEntriesByName("route"))
                                ? void 0
                                : p[0]) ||
                              (null == (p = t.getEntriesByName("appLaunch"))
                                ? void 0
                                : p[0]))
                              ? void 0
                              : t.startTime;
                        f &&
                          ((n.pageNavigationStartTime[f] = null), p) &&
                          (n.pageNavigationStartTime[f] = p),
                          o && (i.appLaunch = o.duration || -1),
                          r && (i.firstScreenTiming = r.duration || -1),
                          a && (i.scriptEvaluateTiming = a.duration || -1),
                          s && (i.pageRouteTiming = s.duration || -1),
                          l && p
                            ? (i.firstPaintTiming = Math.max(l - p, -1))
                            : l &&
                              n.pageNavigationStartTime[f] &&
                              (i.firstPaintTiming = Math.max(
                                l - n.pageNavigationStartTime[f],
                                -1,
                              )),
                          u && p
                            ? (i.LCP = Math.max(u - p, -1))
                            : u &&
                              n.pageNavigationStartTime[f] &&
                              (i.LCP = Math.max(
                                u - n.pageNavigationStartTime[f],
                                -1,
                              )),
                          c && p
                            ? (i.FCP = Math.max(c - p, -1))
                            : c &&
                              n.pageNavigationStartTime[f] &&
                              (i.FCP = Math.max(
                                c - n.pageNavigationStartTime[f],
                                -1,
                              )),
                          0 < Object.keys(i).length && n.publish(i, e);
                      })) &&
                t.observe({ entryTypes: ["navigation", "render", "script"] });
            },
            publish: function (e, t) {
              var n,
                i,
                o,
                r = [],
                a = t.config,
                s =
                  -1 ===
                  (null == (n = t.config.performanceUrl)
                    ? void 0
                    : n.indexOf("?"))
                    ? "?"
                    : "&";
              for (i in e) r.push(i + "=" + e[i]);
              "function" == typeof a.urlHandler
                ? ((o = a.urlHandler() || window.location.href),
                  this.$walk(function (n) {
                    n.send({
                      url:
                        t.config.performanceUrl +
                        s +
                        r.join("&") +
                        "&from=" +
                        encodeURIComponent(o),
                      beanFilter: ["from"],
                      type: A.PERFORMANCE,
                      log: e,
                    });
                  }))
                : this.$walk(function (n) {
                    n.send({
                      url: t.config.performanceUrl + s + r.join("&"),
                      type: A.PERFORMANCE,
                      log: e,
                    });
                  });
            },
            setPagePV: function (e) {
              var t = this;
              ne.onAppRoute &&
                ne.onAppRoute(function (n) {
                  ("appLaunch" === n.openType && !e.config.spa) ||
                    (t.$walk(function (e) {
                      e.send({ url: "" + e.config.pvUrl, type: A.PV });
                    }),
                    t.reportPageLoaded(n));
                });
            },
            reportPageLoaded: function (e) {
              (e =
                "infoType: behaviorBacktracking\ndataType: pageLoadAndRoute\npageLoadedPath: " +
                e.path +
                "\nopenType: " +
                e.openType),
                this.publishNormalLog({ msg: e, level: N.INFO });
            },
            publishNormalLog: function (e) {
              this.$walk(function (t) {
                t.normalLogPipeline(e);
              });
            },
            reportSetDataTiming: function (e) {
              var t,
                n,
                i,
                o,
                r,
                a,
                s,
                l,
                u,
                c = this;
              !0 !==
                (u = void 0 === (u = e.config.setDataReportConfig) ? {} : u)
                  .disabled &&
                ((t = u.timeThreshold),
                (n = !1 !== u.withDataPaths),
                (i = t && 0 < +t ? +t : 30),
                (o = E([
                  m(e, 10),
                  function (t) {
                    (t = t.map(function (e) {
                      return {
                        type: A.SET_DATA,
                        component: e.from,
                        duration: e.duration,
                        fields:
                          e.dataPaths && e.dataPaths.length
                            ? e.dataPaths.sort().join(";")
                            : void 0,
                        size: e.size,
                      };
                    })),
                      e.send({
                        url:
                          e.config.setDataReportUrl +
                          "?payload=" +
                          encodeURIComponent(
                            JSON.stringify({ miniProgramData: t }),
                          ),
                        type: A.SET_DATA,
                        log: t,
                      });
                  },
                ])),
                (r = Page),
                (a = Component),
                (s = function (e, t) {
                  var r,
                    a,
                    s = t.updateStartTimestamp,
                    l = t.updateEndTimestamp;
                  (t = void 0 === (t = t.dataPaths) ? [] : t),
                    (l -= s),
                    isNaN(l) ||
                      l < i ||
                      ((s = { from: e.is, duration: l }),
                      n &&
                        0 < t.length &&
                        Object.assign(s, {
                          dataPaths: t.slice(0, 30),
                          size:
                            ((l = t),
                            (a = 0),
                            null != (r = e) && r.data
                              ? (l.forEach(function (e) {
                                  for (
                                    var t = r.data[e[0]], n = 1, i = e.length;
                                    n < i;
                                    n++
                                  )
                                    t[e[n]] && (t = t[e[n]]);
                                  var o = "";
                                  try {
                                    o = JSON.stringify(t);
                                  } catch (e) {
                                    o = "";
                                  }
                                  a +=
                                    2 *
                                    (void 0 === o ? "" : o).replace(
                                      /[\u4e00-\u9fa5]/g,
                                      "aa",
                                    ).length;
                                }),
                                (a = Math.min(a, 10485760)))
                              : a),
                        }),
                      o(s));
                }),
                (l = function (e) {
                  var t =
                    "infoType: behaviorBacktracking\ndataType: tapEvent" +
                    Object.keys(e[0]).reduce(function (t, n) {
                      var i = "";
                      try {
                        i = n + ": " + JSON.stringify(e[0][n]);
                      } catch (t) {
                        i = "";
                      }
                      return t + "\n" + i;
                    }, "");
                  c.publishNormalLog({ msg: t, level: N.INFO });
                }),
                (Page = function (e) {
                  var t = e.onReady;
                  return (
                    (e.onReady = function () {
                      var e = this;
                      return (
                        "function" ==
                          typeof this.setUpdatePerformanceListener &&
                          this.setUpdatePerformanceListener(
                            { withDataPaths: n },
                            function (t) {
                              s(e, t);
                            },
                          ),
                        null == t ? void 0 : t.call(this)
                      );
                    }),
                    Object.keys(e).forEach(function (t) {
                      var n;
                      "function" != typeof e[t] ||
                        je.includes(t) ||
                        ((n = e[t]),
                        (e[t] = function () {
                          for (var e = [], t = 0; t < arguments.length; t++)
                            e[t] = arguments[t];
                          return (
                            null != e && e[0] && "tap" === e[0].type && l(e),
                            null == n ? void 0 : n.apply(this, e)
                          );
                        }));
                    }),
                    r(e)
                  );
                }),
                (Component = function (e) {
                  e.lifetimes && e.lifetimes.attached
                    ? ((t = e.lifetimes.attached),
                      (e.lifetimes.attached = function () {
                        var e = this;
                        return (
                          "function" ==
                            typeof this.setUpdatePerformanceListener &&
                            this.setUpdatePerformanceListener(
                              { withDataPaths: n },
                              function (t) {
                                s(e, t);
                              },
                            ),
                          null == t ? void 0 : t.call(this)
                        );
                      }))
                    : ((i = e.attached),
                      (e.attached = function () {
                        var e = this;
                        return (
                          "function" ==
                            typeof this.setUpdatePerformanceListener &&
                            this.setUpdatePerformanceListener(
                              { withDataPaths: n },
                              function (t) {
                                s(e, t);
                              },
                            ),
                          null == i ? void 0 : i.call(this)
                        );
                      }));
                  var t,
                    i,
                    o = e.methods;
                  return (
                    o &&
                      "[object Object]" === Object.prototype.toString.call(o) &&
                      Object.keys(o).forEach(function (e) {
                        var t;
                        "function" == typeof o[e] &&
                          ((t = o[e]),
                          (o[e] = function () {
                            for (var e = [], n = 0; n < arguments.length; n++)
                              e[n] = arguments[n];
                            return (
                              null != e && e[0] && "tap" === e[0].type && l(e),
                              null == t ? void 0 : t.apply(this, e)
                            );
                          }));
                      }),
                    a(e)
                  );
                }));
            },
          });
        function He(e) {
          return ((e = ke.call(this, e) || this).taskHack = new qe()), e;
        }
        function Ie() {
          (this.onErrors = []), (this.sends = []);
        }
        return (
          (te = new te({
            name: "reportLoadPackageSpeed",
            isLoaded: !1,
            onNewAegis: function (e) {
              this.isLoaded || ((this.isLoaded = !0), this.start(e));
            },
            start: function () {
              var e = this;
              ne.getPerformance &&
                ne
                  .getPerformance()
                  .createObserver(function (t) {
                    null != (t = t.getEntries()) &&
                      t.forEach(function (t) {
                        "number" != typeof t.duration ||
                          t.duration <= 0 ||
                          e.publishPackageLog(t);
                      });
                  })
                  .observe({ entryTypes: ["loadPackage"] });
            },
            generateLog: function (e) {
              return [
                {
                  type: A.LOAD_PACKAGE,
                  packageName: e.packageName,
                  size: Math.round(100 * e.packageSize) / 100,
                  duration: Math.round(100 * e.duration) / 100,
                },
              ];
            },
            publishPackageLog: function (e) {
              var t = this;
              this.$walk(function (n) {
                var i = t.generateLog(e);
                n.send({
                  url:
                    n.config.setDataReportUrl +
                    "?payload=" +
                    encodeURIComponent(JSON.stringify({ miniProgramData: i })),
                  type: A.LOAD_PACKAGE,
                  log: i,
                });
              });
            },
          })),
          ee.use(ue),
          ee.use(Ce),
          ee.use(le),
          ee.use(_e),
          ee.use(Ue),
          ee.use(te),
          ee.use(ae),
          ee
        );
      });
    },
    function (e) {
      return t({}[e], e);
    },
  ),
  t(1690378507729));
